package com.ygqh.baby.model;

import java.math.BigDecimal;
import java.util.Date;

import com.ygqh.baby.utils.DateConvertUtils;

public class ActivityGiveawayModel implements Comparable<ActivityGiveawayModel> {
	private String activityName;
	private String sourceCode;
	private BigDecimal payPrice;
	private String skuCode;
	private Date startDate;
	private Date endDate;
	private Long giveCount;
	private Long giveNumber;
	private Boolean checkStock;

	public Boolean getCheckStock() {
		return checkStock;
	}

	public void setCheckStock(Boolean checkStock) {
		this.checkStock = checkStock;
	}

	public String getActivityName() {
		return activityName;
	}

	public void setActivityName(String activityName) {
		this.activityName = activityName;
	}

	public String getSourceCode() {
		return sourceCode;
	}

	public void setSourceCode(String sourceCode) {
		this.sourceCode = sourceCode;
	}

	public BigDecimal getPayPrice() {
		return payPrice;
	}

	public void setPayPrice(BigDecimal payPrice) {
		this.payPrice = payPrice;
	}

	public String getSkuCode() {
		return skuCode;
	}

	public void setSkuCode(String skuCode) {
		this.skuCode = skuCode;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Long getGiveCount() {
		return giveCount;
	}

	public void setGiveCount(Long giveCount) {
		this.giveCount = giveCount;
	}

	public Long getGiveNumber() {
		return giveNumber;
	}

	public void setGiveNumber(Long giveNumber) {
		this.giveNumber = giveNumber;
	}

	public Boolean isValid() {

		Date currentDate = new Date();
		// System.out.println(activityName+ "   currentDate =" +
		// DateConvertUtils.format(currentDate));
		// System.out.println(activityName+ "	 endDate =" +
		// DateConvertUtils.format(endDate));
		endDate = DateConvertUtils.addDay(endDate, 1);
		if (currentDate.after(endDate)) {
			return false;
		}
		return true;

	}

	@Override
	public int compareTo(ActivityGiveawayModel o) {
		return o.getPayPrice().compareTo(o.getPayPrice());
	}

}
